package com.stellar.circle.basic.service.impl;

import com.stellar.circle.basic.dao.SPostTagMappingDao;
import com.stellar.circle.basic.entity.SPostTagMapping;
import com.stellar.circle.basic.service.SPostTagMappingService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

/**
 * 帖子话题关联表(SPostTagMapping)服务实现
 *
 * @author Jqchan
 * @since 2025-05-17 19:30:47
 */
@Service
public class SPostTagMappingServiceImpl implements SPostTagMappingService {

    @Resource
    private SPostTagMappingDao sPostTagMappingDao;

    @Override
    public SPostTagMapping queryById(Long id) {
        return sPostTagMappingDao.queryById(id);
    }

    @Override
    public SPostTagMapping queryByCondition(SPostTagMapping condition) {
        return sPostTagMappingDao.queryByCondition(condition);
    }

    @Override
    public List<SPostTagMapping> queryAllByCondition(SPostTagMapping condition) {
        return sPostTagMappingDao.queryAllByCondition(condition);
    }

    @Override
    public List<SPostTagMapping> page(SPostTagMapping condition, int page, int pageSize) {
        return sPostTagMappingDao.page(condition, page, pageSize);
    }

    @Override
    public int insert(SPostTagMapping entity) {
        return sPostTagMappingDao.insert(entity);
    }

    @Override
    public int update(SPostTagMapping entity) {
        return sPostTagMappingDao.update(entity);
    }

    @Override
    public int deleteById(Long id) {
        return sPostTagMappingDao.deleteById(id);
    }

    @Override
    public Long count(SPostTagMapping condition) {
        return sPostTagMappingDao.count(condition);
    }

    @Override
    public void batchInsert(List<SPostTagMapping> sPostTagMappings) {
        sPostTagMappingDao.insertBatch(sPostTagMappings);
    }

    @Override
    public void deleteByPostId(Long postId) {
        sPostTagMappingDao.deleteByPostId(postId);
    }

    @Override
    public Long countBySchool(Long schoolId) {
        return sPostTagMappingDao.countBySchool(schoolId);
    }

    @Override
    public List<SPostTagMapping> pageBySchoolId(Long schoolId, Integer start, Integer pageSize) {
        return sPostTagMappingDao.pageBySchoolId(schoolId, start, pageSize);
    }
}
